<extend name="Public/base"/>

<block name="body">
	<div class="main-title">
		<h2>排单数据</h2>
	</div>

	<!-- 表格列表 -->
	<div class="tb-unit posr">
		<div class="tb-unit-bar">
			
		</div>
		<div class="category">
			<div class="hd cf">
				<div class="fold">星期</div>
				<div class="order">09-10点</div>
				<div class="order">11-12点</div>
				<div class="order">13-14点</div>
				<div class="order">15-16点</div>
				<div class="order">17-18点</div>
				<div class="order">19-20点</div>
				<div class="order">21-22点</div>
			</div>
			<volist name="lists" id="list">
				<dl class="cate-item">
					<dt class="cf">
						<form action="{:U('edit')}" method="post">

							<div class="fold">{$list.id|get_xingqi}</div>
							<div class="order"><input type="text" name="aa" class="text input-mini" value="{$list.aa}"></div>
							<div class="order"><input type="text" name="bb" class="text input-mini" value="{$list.bb}"></div>
							<div class="order"><input type="text" name="cc" class="text input-mini" value="{$list.cc}"></div>
							<div class="order"><input type="text" name="dd" class="text input-mini" value="{$list.dd}"></div>
							<div class="order"><input type="text" name="ee" class="text input-mini" value="{$list.ee}"></div>
							<div class="order"><input type="text" name="ff" class="text input-mini" value="{$list.ff}"></div>
							<div class="order"><input type="text" name="gg" class="text input-mini" value="{$list.gg}"></div>
							<!-- <div class="order">{$list['status']?'启动':'禁用'}</div> -->

							<div class="name" >
								<span class="tab-sign"></span>
								<input type="hidden" name="id" value="{$list.id}">
								<span class="help-inline msg"></span>
							</div>
						
						</form>
					</dt>
				</dl>
			</volist>
		</div>
	</div>
	<!-- /表格列表 -->
</block>

<block name="script">
	<script type="text/javascript">
		(function($){
			$('.ywqx').change(function(){
				//获取ywqx类别邻居属性并赋值光标离开。
				$(this).next().val($(this).val()).focusout();

			});

			/* 实时更新分类信息 */
			$(".category")
				.on("submit", "form", function(){
					var self = $(this);
					$.post(
						self.attr("action"),
						self.serialize(),
						function(data){
							/* 提示信息 */
							var name = data.status ? "success" : "error", msg;
							msg = self.find(".msg").addClass(name).text(data.info)
									  .css("display", "inline-block");
							setTimeout(function(){
								msg.fadeOut(function(){
									msg.text("").removeClass(name);
								});
							}, 1000);
						},
						"json"
					);
					return false;
				})
                .on("focus","input",function(){
                    $(this).data('param',$(this).closest("form").serialize());

                })
                .on("blur", "input", function(){
                    if($(this).data('param')!=$(this).closest("form").serialize()){
                        $(this).closest("form").submit();
                    }
                });
		})(jQuery);
	</script>
		
</block>
